package net.fkm.gaodemaptest;

import android.app.Activity;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;
import butterknife.ButterKnife;

public class MainActivity extends AppCompatActivity implements OnClickListener{
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();

    }

    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        setContentView(R.layout.activity_main);
        initView();
    }
    public void onResume() {
        super.onResume();
    }

    public void onPause() {
        super.onPause();
    }

    public void initView() {
        TextView btn_gps=(TextView)findViewById(R.id.btn_gps);
        btn_gps.setOnClickListener(this);
        TextView btn_amap_click=(TextView)findViewById(R.id.btn_amap_click);
        btn_amap_click.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        Intent intent=null;
        switch (v.getId()){
            case R.id.btn_gps:
                intent=new Intent(this, GpsActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_amap_click:
                intent=new Intent(this, EventsActivity.class);
                startActivity(intent);
                break;
            default:
                break;
        }
    }
}